package com.fyx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fyx.entity.BindPlayer;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BindPlayerMapper extends BaseMapper<BindPlayer> {


    @Select({"<script>" ,
            "SELECT count(user_id) as user_id,sum(bind_num) as bind_num ,sum(bind_new) as bind_new FROM bind_player where 1=1 ",
            "<when test='channel!=null and channel!=&apos;&apos;'>",
            "AND channel = #{channel}",
            "</when>",
            "<when test='userId!=null and userId!=&apos;&apos;'>",
            "AND user_id  = #{userId}",
            "</when>",
            "order by bind_num DESC",
            "</script>"})
    List<BindPlayer> getBindList(BindPlayer bindPlayer);
}
